home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_nearmisstalk.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  121 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_NearMissTalk.cog
  4. #
  5. # Indy notes almost succeeding
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ==============================================================================
  11.  
  12. # NOTE: This is a random verbal reaction when Indy's efforts almost succeed.
  13. # Glue it into your level and reach it from a calling cog like this:
  14. #
  15. # 1. Create a valid reference to this cog in your calling cog;
  16. #
  17. # 2. Use the following verb:
  18. #    SendMessageEx(thiscogREF, i_userMessage, f_parm0, f_parm1, f_parm2, f_parm3);
  19. #    (see each section below for details...)
  20. #
  21. # 3. Use global15 as a semaphore and return value where neeeded;
  22. #
  23. # The resulting chatter is pre-approved by HB...
  24. #
  25. # PRODUCT SUPPORT:  cogsrus x8371
  26.  
  27. # ==============================================================================
  28.  
  29. symbols
  30.  
  31. # ................................. MESSAGES ...................................
  32.  
  33.     message user0    # near miss lines
  34.  
  35. # ................................. SAY LINES ..................................
  36.  
  37.     # near miss lines...
  38.     sound    in_sayline=Inxj093.wav                local # Good idea-->in_sayline[0]
  39.     sound    in_perfectnot=Inxj094.wav            local # Perfect world...but not this one
  40.     sound    in_mustbediff=Inxj095.wav            local # Must be a different way
  41.     sound    in_notquite=Inxj092.wav                local # Hmm, didn't quite work
  42.  
  43. # ............................... VARIABLES ....................................
  44.  
  45.     flex    talkerREF                            local
  46.     flex    forceTalk                            local
  47.     flex    forceLine                            local
  48.     
  49.     int        alreadyworking=0                    local
  50.  
  51.     int        newline=50                            local # init outside actual range
  52.     int        oldline=50                            local
  53.  
  54.     int        errorstop=0            # RKD: used to keep Marcus from asking for references    
  55.  
  56. end
  57.  
  58. # ==============================================================================
  59.  
  60. code
  61.  
  62. user0:
  63.  
  64.     # NOTE: Indy expresses DOUBT that something he tries will work...
  65.     # (Useful when Indy does something so offbeat that it doesn't
  66.     # even qualify as a legitimate failed attempt)
  67.     #
  68.     # Proper command to reach this response section from the calling cog is:
  69.     #
  70.     # SendMessageEx(negtalkcogREF, user0, f_talkerREF, f_forceTalk, f_forceLine, 0);
  71.     #
  72.     # global15 is used here like so:
  73.     #
  74.     # global15 == 0 while this cog is at work (waiting for line to finish)
  75.     # global15 == 1 upon return
  76.     #
  77.     # As discussed in user0 section, the calling cog can use global15 as a semaphore
  78.     #
  79.     # Hey!  You can also force a line choice.  Here's how:
  80.     # 1. Note your intention by setting f_forceTalk parm to some non-zero value
  81.     # 2. Examine the available lines to find the one you want (counting from 0)
  82.     # 3. Pass that number in the forceLine parameter (parm2)
  83.  
  84.     if (alreadyworking > 0)
  85.     {
  86.         return;
  87.     }
  88.  
  89.     alreadyworking = 1; # stall multiple calls
  90.  
  91.     global15 = 0; # init each call
  92.  
  93.     talkerREF = GetParam(0); # is player or an actor talking? (a cast)
  94.     forceTalk = GetParam(1); # force a choice
  95.     forceLine = GetParam(2); # actual line choice
  96.     
  97.     if (forceTalk > 0)
  98.     {
  99.         newline = forceLine; # choose this line
  100.         oldline = 0;
  101.     }
  102.     
  103.     while (newline == oldline)
  104.     {        
  105.         newline = RandBetween(0, 3);
  106.     }
  107.     oldline = newline; # remember choice
  108.  
  109.     PlayVoice(talkerREF, in_sayline[newline], 1, 1);
  110.  
  111.     global15 = 1;
  112.  
  113.     alreadyworking = 0;
  114.  
  115.     # RKD: prevent Marcus from asking about new symbols and cogsniffer from reporting unused symbol
  116.     errorstop = 0;
  117.     return;
  118.  
  119. end
  120.  
  121.